package com.springboot.mail.common.bean;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @description: 功能描述: 分页数据封装类
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(description = "分页数据封装类")
public class MyPage<T> {
    @ApiModelProperty(value = "页码", example = "1")
    private long pageNo;
    @ApiModelProperty(value = "分页大小", example = "20")
    private long pageSize;
    @ApiModelProperty(value = "数据总数", example = "100")
    private long total;
    @ApiModelProperty(value = "分页数量", example = "30")
    private long pages;
    @ApiModelProperty(value = "分页数据")
    private List<T> data;

    public MyPage(long pageNo, long pageSize) {
        this.pageNo = pageNo;
        this.pageSize = pageSize;
    }
}
